home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / recode.lha / recode-3.2.4 / txtelat1.l < prev    next >
Text File  |  1992-08-19  |  4KB  |  140 lines

  1. %{
  2. /* Conversion of files between different charsets and usages.
  3.    Copyright (C) 1990 Free Software Foundation, Inc.
  4.    Francois Pinard <pinard@iro.umontreal.ca>, 1989.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #define STEP    texte_latin1
  22.  
  23. extern char diaeresis_char;    /* Character for diaeresis */
  24.  
  25. void
  26. texte_latin1_diaeresis (void)
  27. {
  28.   int counter;
  29.  
  30.   for (counter = 0; counter < yyleng; counter++)
  31.     if (yytext[counter+1] == diaeresis_char)
  32.       {
  33.     switch (yytext[counter])
  34.       {
  35.         /* The following #ifdef removes the case 'A': this seemingly
  36.            unrelated line triggers a `NULL in input' diagnostic in flex.
  37.            Would you believe?  */
  38. #if 0
  39.       case 'A': output ('\304'); break;
  40. #endif
  41.       case 'E': output ('\313'); break;
  42.       case 'I': output ('\317'); break;
  43.       case 'O': output ('\326'); break;
  44.       case 'U': output ('\334'); break;
  45.       case 'a': output ('\344'); break;
  46.       case 'e': output ('\353'); break;
  47.       case 'i': output ('\357'); break;
  48.       case 'o': output ('\366'); break;
  49.       case 'u': output ('\374'); break;
  50.       case 'y': output ('\377'); break;
  51.       default:  output (yytext[counter]);
  52.       }
  53.     counter++;
  54.       }
  55.     else
  56.       output (yytext[counter]);
  57. }
  58. %}
  59.  
  60. s            (^|[^a-zA-Z])
  61. d            [:"]
  62. l            [a-zA-Z]
  63.  
  64. %%
  65.  
  66. ``            { output ('\253'); }
  67. ''            { output ('\273'); }
  68.  
  69. A`            { output ('\300'); }
  70. A^            { output ('\302'); }
  71. A{d}/{l}        { output ('\304'); }
  72. a`            { output ('\340'); }
  73. a^            { output ('\342'); }
  74. a{d}/{l}        { output ('\344'); }
  75.  
  76. C\,/[aAoOuU]        { output ('\307'); }
  77. c\,/[aAoOuU]        { output ('\347'); }
  78.  
  79. E`            { output ('\310'); }
  80. E'''            { output ('\311'); output ('\273'); }
  81. E''            { output ('E'); output ('\273'); }
  82. E'            { output ('\311'); }
  83. E^            { output ('\312'); }
  84. E{d}/{l}        { output ('\313'); }
  85. e`            { output ('\350'); }
  86. e'''            { output ('\351'); output ('\273'); }
  87. e''            { output ('e'); output ('\273'); }
  88. e'            { output ('\351'); }
  89. e^            { output ('\352'); }
  90. e{d}/{l}        { output ('\353'); }
  91.  
  92. I`            { output ('\314'); }
  93. I^            { output ('\316'); }
  94. I{d}/{l}        { output ('\317'); }
  95. i`            { output ('\354'); }
  96. i^            { output ('\356'); }
  97. i{d}/{l}        { output ('\357'); }
  98.  
  99. O`            { output ('\322'); }
  100. O^            { output ('\324'); }
  101. O{d}/{l}        { output ('\326'); }
  102. o`            { output ('\362'); }
  103. o^            { output ('\364'); }
  104. o{d}/{l}        { output ('\366'); }
  105.  
  106. U`            { output ('\331'); }
  107. U^            { output ('\333'); }
  108. U{d}/{l}        { output ('\334'); }
  109. u`            { output ('\371'); }
  110. u^            { output ('\373'); }
  111. u{d}/{l}        { output ('\374'); }
  112.  
  113. Y{d}/{l}        { output ('Y'); }
  114. y{d}/{l}        { output ('\337'); }
  115.  
  116. {s}[Bb]esaigue{d}    { texte_latin1_diaeresis (); }
  117. {s}[Cc]igue{d}        { texte_latin1_diaeresis (); }
  118. {s}[Aa]igue{d}        { texte_latin1_diaeresis (); }
  119. {s}[Aa]mbigue{d}    { texte_latin1_diaeresis (); }
  120. {s}[Cc]ontigue{d}    { texte_latin1_diaeresis (); }
  121. {s}[Ee]xigue{d}        { texte_latin1_diaeresis (); }
  122. {s}[Ss]ubaigue{d}    { texte_latin1_diaeresis (); }
  123. {s}[Ss]uraigue{d}    { texte_latin1_diaeresis (); }
  124. {s}[Aa]i{d}        { texte_latin1_diaeresis (); }
  125. {s}[Cc]ongai{d}        { texte_latin1_diaeresis (); }
  126. {s}[Gg]oi{d}        { texte_latin1_diaeresis (); }
  127. {s}[Hh]ai{d}kai{d}    { if (yytext[4] == diaeresis_char)
  128.                 texte_latin1_diaeresis ();
  129.               else
  130.                 ECHO;
  131.             }
  132. {s}[Ii]noui{d}        { texte_latin1_diaeresis (); }
  133. [JjTtLl]'[Aa][Ii]{d}    { ECHO; }
  134. {s}[Ss]ai{d}        { texte_latin1_diaeresis (); }
  135. {s}[Ss]amurai{d}    { texte_latin1_diaeresis (); }
  136. {s}[Tt]hai{d}        { texte_latin1_diaeresis (); }
  137. {s}[Tt]okai{d}        { texte_latin1_diaeresis (); }
  138. {s}[Cc]anoe{d}        { texte_latin1_diaeresis (); }
  139. {s}Esau{d}        { texte_latin1_diaeresis (); }
  140.